package com.xmy.controller;

import com.xmy.api.ICouponService;
import com.xmy.entity.Result;
import com.xmy.pojo.ShopCoupon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * @author wangjinlinag
 * @Classname CouponController
 * @Description TODO
 * @Date 2021/5/12 1:57 下午
 */
@RequestMapping
@RestController
public class CouponController {
    @Autowired
    private ICouponService couponService;

    @GetMapping("/coupon/{id}")
    public ShopCoupon findOne(@PathParam("id")Long couponId){
        return couponService.findOne(couponId);
    }

    @GetMapping("/coupon/updateCouponStatus")
    public Result findOne(@RequestBody ShopCoupon shopCoupon){
         return couponService.updateCouponStatus(shopCoupon);
    }
}
